<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>Faiss: faiss::RankingScore2 Struct Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Faiss
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Friends</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespacefaiss.html">faiss</a></li><li class="navelem"><a class="el" href="structfaiss_1_1RankingScore2.html">RankingScore2</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-attribs">Public Attributes</a> &#124;
<a href="structfaiss_1_1RankingScore2-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">faiss::RankingScore2 Struct Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="dynheader">
Inheritance diagram for faiss::RankingScore2:</div>
<div class="dyncontent">
 <div class="center">
  <img src="structfaiss_1_1RankingScore2.png" usemap="#faiss::RankingScore2_map" alt=""/>
  <map id="faiss::RankingScore2_map" name="faiss::RankingScore2_map">
<area href="structfaiss_1_1Score3Computer.html" alt="faiss::Score3Computer&lt; float, double &gt;" shape="rect" coords="0,56,234,80"/>
<area href="structfaiss_1_1PermutationObjective.html" title="abstract class for the loss function " alt="faiss::PermutationObjective" shape="rect" coords="0,0,234,24"/>
</map>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a516d4452bd09fb2d15d7d2048a2489e5"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a516d4452bd09fb2d15d7d2048a2489e5"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>RankingScore2</b> (int nbits, int nq, int nb, const uint32_t *qcodes, const uint32_t *bcodes, const float *gt_distances)</td></tr>
<tr class="separator:a516d4452bd09fb2d15d7d2048a2489e5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a40c9d8e86d82e98e383f3553b9ec87ef"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a40c9d8e86d82e98e383f3553b9ec87ef"></a>
double&#160;</td><td class="memItemRight" valign="bottom"><b>rank_weight</b> (int r)</td></tr>
<tr class="separator:a40c9d8e86d82e98e383f3553b9ec87ef"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a16c753a4136b3c851ea81133a26a02da"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structfaiss_1_1RankingScore2.html#a16c753a4136b3c851ea81133a26a02da">accum_gt_weight_diff</a> (const std::vector&lt; int &gt; &amp;a, const std::vector&lt; int &gt; &amp;b)</td></tr>
<tr class="separator:a16c753a4136b3c851ea81133a26a02da"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a98d0a8d18200f386a13e1e7c59b00a0e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a98d0a8d18200f386a13e1e7c59b00a0e"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>init_n_gt</b> ()</td></tr>
<tr class="separator:a98d0a8d18200f386a13e1e7c59b00a0e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_structfaiss_1_1Score3Computer"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_structfaiss_1_1Score3Computer')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="structfaiss_1_1Score3Computer.html">faiss::Score3Computer&lt; float, double &gt;</a></td></tr>
<tr class="memitem:a07a726903418960a2d8000506d88f8e6 inherit pub_methods_structfaiss_1_1Score3Computer"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structfaiss_1_1Score3Computer.html#a07a726903418960a2d8000506d88f8e6">compute</a> (const int *perm) const</td></tr>
<tr class="separator:a07a726903418960a2d8000506d88f8e6 inherit pub_methods_structfaiss_1_1Score3Computer"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a567feac7ddd3bb467a9ed30671caccb1 inherit pub_methods_structfaiss_1_1Score3Computer"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structfaiss_1_1Score3Computer.html#a567feac7ddd3bb467a9ed30671caccb1">compute_update</a> (const int *perm, int iw, int jw) const</td></tr>
<tr class="separator:a567feac7ddd3bb467a9ed30671caccb1 inherit pub_methods_structfaiss_1_1Score3Computer"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1a44799c391adf3a9170e96e7643e9ae inherit pub_methods_structfaiss_1_1Score3Computer"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1a44799c391adf3a9170e96e7643e9ae"></a>
double&#160;</td><td class="memItemRight" valign="bottom"><b>update_i</b> (const int *perm, int iw, int jw, int ip0, int ip, const float *n_gt_i) const</td></tr>
<tr class="separator:a1a44799c391adf3a9170e96e7643e9ae inherit pub_methods_structfaiss_1_1Score3Computer"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8a9f9d95c9a4c0948cb5df0b04c5ebc8 inherit pub_methods_structfaiss_1_1Score3Computer"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8a9f9d95c9a4c0948cb5df0b04c5ebc8"></a>
double&#160;</td><td class="memItemRight" valign="bottom"><b>update_i_plane</b> (const int *perm, int iw, int jw, int ip0, int ip, const float *n_gt_i) const</td></tr>
<tr class="separator:a8a9f9d95c9a4c0948cb5df0b04c5ebc8 inherit pub_methods_structfaiss_1_1Score3Computer"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a227601c3dc8779bb13747ba04934e0c8 inherit pub_methods_structfaiss_1_1Score3Computer"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a227601c3dc8779bb13747ba04934e0c8"></a>
double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structfaiss_1_1Score3Computer.html#a227601c3dc8779bb13747ba04934e0c8">update_k</a> (const int *perm, int iw, int jw, int ip0, int ip, int jp0, int jp, int k, const float *n_gt_ij) const</td></tr>
<tr class="memdesc:a227601c3dc8779bb13747ba04934e0c8 inherit pub_methods_structfaiss_1_1Score3Computer"><td class="mdescLeft">&#160;</td><td class="mdescRight">used for the 8 cells were the 3 indices are swapped <br/></td></tr>
<tr class="separator:a227601c3dc8779bb13747ba04934e0c8 inherit pub_methods_structfaiss_1_1Score3Computer"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a98da6005edbb5ec26311bc947866122d inherit pub_methods_structfaiss_1_1Score3Computer"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a98da6005edbb5ec26311bc947866122d"></a>
double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structfaiss_1_1Score3Computer.html#a98da6005edbb5ec26311bc947866122d">update_j_line</a> (const int *perm, int iw, int jw, int ip0, int ip, int jp0, int jp, const float *n_gt_ij) const</td></tr>
<tr class="memdesc:a98da6005edbb5ec26311bc947866122d inherit pub_methods_structfaiss_1_1Score3Computer"><td class="mdescLeft">&#160;</td><td class="mdescRight">compute update on a line of k's, where i and j are swapped <br/></td></tr>
<tr class="separator:a98da6005edbb5ec26311bc947866122d inherit pub_methods_structfaiss_1_1Score3Computer"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acf371848bac76ba275ceb5e10f805d33 inherit pub_methods_structfaiss_1_1Score3Computer"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="acf371848bac76ba275ceb5e10f805d33"></a>
double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structfaiss_1_1Score3Computer.html#acf371848bac76ba275ceb5e10f805d33">update_i_cross</a> (const int *perm, int iw, int jw, int ip0, int ip, const float *n_gt_i) const</td></tr>
<tr class="memdesc:acf371848bac76ba275ceb5e10f805d33 inherit pub_methods_structfaiss_1_1Score3Computer"><td class="mdescLeft">&#160;</td><td class="mdescRight">considers the 2 pairs of crossing lines j=iw or jw and k = iw or kw <br/></td></tr>
<tr class="separator:acf371848bac76ba275ceb5e10f805d33 inherit pub_methods_structfaiss_1_1Score3Computer"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1c4537d67802aef28ccc57c4bd87f766 inherit pub_methods_structfaiss_1_1Score3Computer"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structfaiss_1_1Score3Computer.html#a1c4537d67802aef28ccc57c4bd87f766">compute_cost</a> (const int *perm) const override</td></tr>
<tr class="separator:a1c4537d67802aef28ccc57c4bd87f766 inherit pub_methods_structfaiss_1_1Score3Computer"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acbce8973c5294f8495a89100c111c5b3 inherit pub_methods_structfaiss_1_1Score3Computer"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="acbce8973c5294f8495a89100c111c5b3"></a>
double&#160;</td><td class="memItemRight" valign="bottom"><b>cost_update</b> (const int *perm, int iw, int jw) const override</td></tr>
<tr class="separator:acbce8973c5294f8495a89100c111c5b3 inherit pub_methods_structfaiss_1_1Score3Computer"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:a8f7486db4ad59b06ab40284b6b332fff"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8f7486db4ad59b06ab40284b6b332fff"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><b>nbits</b></td></tr>
<tr class="separator:a8f7486db4ad59b06ab40284b6b332fff"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab20c0ca074168ceeb13fab75073bdd0f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab20c0ca074168ceeb13fab75073bdd0f"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><b>nq</b></td></tr>
<tr class="separator:ab20c0ca074168ceeb13fab75073bdd0f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a77861e38ee05ba280428009b18e564ab"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a77861e38ee05ba280428009b18e564ab"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><b>nb</b></td></tr>
<tr class="separator:a77861e38ee05ba280428009b18e564ab"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a293656590e04ca0c85d814030821138f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a293656590e04ca0c85d814030821138f"></a>
const uint32_t *&#160;</td><td class="memItemRight" valign="bottom"><b>qcodes</b></td></tr>
<tr class="separator:a293656590e04ca0c85d814030821138f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af3a82001ba8b82d30278cfc493c50bb4"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af3a82001ba8b82d30278cfc493c50bb4"></a>
const uint32_t *&#160;</td><td class="memItemRight" valign="bottom"><b>bcodes</b></td></tr>
<tr class="separator:af3a82001ba8b82d30278cfc493c50bb4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a03aa1bf0380556ce42c85719f3dfbcb6"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a03aa1bf0380556ce42c85719f3dfbcb6"></a>
const float *&#160;</td><td class="memItemRight" valign="bottom"><b>gt_distances</b></td></tr>
<tr class="separator:a03aa1bf0380556ce42c85719f3dfbcb6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_attribs_structfaiss_1_1Score3Computer"><td colspan="2" onclick="javascript:toggleInherit('pub_attribs_structfaiss_1_1Score3Computer')"><img src="closed.png" alt="-"/>&#160;Public Attributes inherited from <a class="el" href="structfaiss_1_1Score3Computer.html">faiss::Score3Computer&lt; float, double &gt;</a></td></tr>
<tr class="memitem:a39a449545b35ca4a3a01db109526832e inherit pub_attribs_structfaiss_1_1Score3Computer"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a39a449545b35ca4a3a01db109526832e"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><b>nc</b></td></tr>
<tr class="separator:a39a449545b35ca4a3a01db109526832e inherit pub_attribs_structfaiss_1_1Score3Computer"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac054431b63a010a8cfe013b40eac746a inherit pub_attribs_structfaiss_1_1Score3Computer"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac054431b63a010a8cfe013b40eac746a"></a>
std::vector&lt; float &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>n_gt</b></td></tr>
<tr class="separator:ac054431b63a010a8cfe013b40eac746a inherit pub_attribs_structfaiss_1_1Score3Computer"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_attribs_structfaiss_1_1PermutationObjective"><td colspan="2" onclick="javascript:toggleInherit('pub_attribs_structfaiss_1_1PermutationObjective')"><img src="closed.png" alt="-"/>&#160;Public Attributes inherited from <a class="el" href="structfaiss_1_1PermutationObjective.html">faiss::PermutationObjective</a></td></tr>
<tr class="memitem:a81657be192b4589b13a3f51fc0765c2f inherit pub_attribs_structfaiss_1_1PermutationObjective"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a81657be192b4589b13a3f51fc0765c2f"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><b>n</b></td></tr>
<tr class="separator:a81657be192b4589b13a3f51fc0765c2f inherit pub_attribs_structfaiss_1_1PermutationObjective"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock">
<p>Definition at line <a class="el" href="PolysemousTraining_8cpp_source.html#l00655">655</a> of file <a class="el" href="PolysemousTraining_8cpp_source.html">PolysemousTraining.cpp</a>.</p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a16c753a4136b3c851ea81133a26a02da"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">double faiss::RankingScore2::accum_gt_weight_diff </td>
          <td>(</td>
          <td class="paramtype">const std::vector&lt; int &gt; &amp;&#160;</td>
          <td class="paramname"><em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::vector&lt; int &gt; &amp;&#160;</td>
          <td class="paramname"><em>b</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>count nb of i, j in a x b st. i &lt; j a and b should be sorted on input they are the ranks of j and k respectively. specific version for diff-of-rank weighting, cannot optimized with a cumulative table </p>

<p>Definition at line <a class="el" href="PolysemousTraining_8cpp_source.html#l00683">683</a> of file <a class="el" href="PolysemousTraining_8cpp_source.html">PolysemousTraining.cpp</a>.</p>

</div>
</div>
<hr/>The documentation for this struct was generated from the following file:<ul>
<li>/data/users/hoss/faiss/<a class="el" href="PolysemousTraining_8cpp_source.html">PolysemousTraining.cpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.5
</small></address>
</body>
</html>
